package nodes

import (
	"gitee.com/zfd81/dbrs/sql"
	"vitess.io/vitess/go/sqltypes"
)

// ShowEngines is a node that shows the databases.
type ShowEngines struct {
}

// NewShowDatabases creates a new show databases node.
func NewShowEngines() *ShowEngines {
	return new(ShowEngines)
}

// Resolved implements the Resolvable interface.
func (p *ShowEngines) Resolved() bool {
	return true
}

// Schema implements the Node interface.
func (*ShowEngines) Schema() sql.Schema {

	return sql.Schema{
		{Name: "engine", Type: sqltypes.VarChar, Default: sqltypes.NULL, Nullable: false, Source: "engines"},
		{Name: "support", Type: sqltypes.VarChar, Default: sqltypes.NULL, Nullable: false, Source: "engines"},
		{Name: "comment", Type: sqltypes.VarChar, Default: sqltypes.NULL, Nullable: false, Source: "engines"},
		{Name: "transactions", Type: sqltypes.VarChar, Default: sqltypes.NULL, Nullable: false, Source: "engines"},
		{Name: "xa", Type: sqltypes.VarChar, Default: sqltypes.NULL, Nullable: false, Source: "engines"},
		{Name: "savepoints", Type: sqltypes.VarChar, Default: sqltypes.NULL, Nullable: false, Source: "engines"},
	}
}

func (p ShowEngines) String() string {
	return "ShowEngines"
}
